#include <stdio.h>

void a_1()
{
	int *a = 1;
	int byte1, byte2, byte3, byte4;
	int b = 2;

	byte1 = byte2 = byte3 = byte4 = 0;

	printf("a=%x\n", a);	// 1
	printf("a=%x\n", &a);	// b7d24708

	printf("0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n", &a[0], &a[1], &a[2], &a[3], &a[4], &a[5]); // 0x1 0x5 0x9 0xd 0x11 0x15
	//printf("%x %x %x %x\n", a[0], a[1], a[2], a[3]);	 // Segmentation fault (core dumped)

	byte1 = (char *)&a[0];
	byte2 = (char *)&a[1];
	byte3 = (char *)&a[2];
	byte4 = (char *)&a[3];

	printf("%x %x %x %x\n", byte1, byte2, byte3, byte4); // 1 5 9 d

	a = &b;
	printf("b=%x\n", &b);	// b7d246f4
	printf("a=%x\n", a);	// b7d246f4
	printf("a=%x\n", *a);	// 2
}

void a_0()
{
	int *a = 0;
	int byte1, byte2, byte3, byte4;

	byte1 = byte2 = byte3 = byte4 = 0;

	printf("a=%x\n", a);	// 0	指向地址0
	//printf("a=%d\n", *a);	// Segmentation fault (core dumped) 取地址0上的数据，报错
	printf("a=%x\n", &a);	// c03f1498

	printf("0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n", &a[0], &a[1], &a[2], &a[3], &a[4], &a[5]); // 0x0 0x4 0x8 0xc 0x10 0x14
	//printf("%x %x %x %x\n", a[0], a[1], a[2], a[3]);	 // Segmentation fault (core dumped)

	byte1 = (char *)&a[0];
	byte2 = (char *)&a[1];
	byte3 = (char *)&a[2];
	byte4 = (char *)&a[3];

	printf("%x %x %x %x\n", byte1, byte2, byte3, byte4); // 0 4 8 c
}

void a_3()
{
	int *a = 3;
	int byte1, byte2, byte3, byte4;

	byte1 = byte2 = byte3 = byte4 = 0;

	printf("a=%x\n", a);	// 3
	printf("a=%x\n", &a);	// ce340a48

	printf("0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n", &a[0], &a[1], &a[2], &a[3], &a[4], &a[5]); // 0x3 0x7 0xb 0xf 0x13 0x17
	//printf("%x %x %x %x\n", a[0], a[1], a[2], a[3]);	 // Segmentation fault (core dumped)

	byte1 = (char *)&a[0];
	byte2 = (char *)&a[1];
	byte3 = (char *)&a[2];
	byte4 = (char *)&a[3];

	printf("%x %x %x %x\n", byte1, byte2, byte3, byte4); // 3 7 b f
}

void main()
{
	a_1();
	a_0();
	a_3();
}


#if 0
/*
 * intel
 */
0000000000001169 <a_1>:
    1169:	f3 0f 1e fa          	endbr64 
    116d:	55                   	push   %rbp
    116e:	48 89 e5             	mov    %rsp,%rbp
    1171:	48 83 ec 30          	sub    $0x30,%rsp
    1175:	64 48 8b 04 25 28 00 	mov    %fs:0x28,%rax
    117c:	00 00 
    117e:	48 89 45 f8          	mov    %rax,-0x8(%rbp)
    1182:	31 c0                	xor    %eax,%eax
    1184:	48 c7 45 f0 01 00 00 	movq   $0x1,-0x10(%rbp)
    118b:	00 
    118c:	c7 45 dc 02 00 00 00 	movl   $0x2,-0x24(%rbp)
    1193:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%rbp)
    119a:	8b 45 e0             	mov    -0x20(%rbp),%eax
    119d:	89 45 e4             	mov    %eax,-0x1c(%rbp)
    11a0:	8b 45 e4             	mov    -0x1c(%rbp),%eax
    11a3:	89 45 e8             	mov    %eax,-0x18(%rbp)
    11a6:	8b 45 e8             	mov    -0x18(%rbp),%eax
    11a9:	89 45 ec             	mov    %eax,-0x14(%rbp)
    11ac:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    11b0:	48 89 c6             	mov    %rax,%rsi
    11b3:	48 8d 3d 4e 0e 00 00 	lea    0xe4e(%rip),%rdi        # 2008 <_IO_stdin_used+0x8>
    11ba:	b8 00 00 00 00       	mov    $0x0,%eax
    11bf:	e8 ac fe ff ff       	callq  1070 <printf@plt>
    11c4:	48 8d 45 f0          	lea    -0x10(%rbp),%rax
    11c8:	48 89 c6             	mov    %rax,%rsi
    11cb:	48 8d 3d 36 0e 00 00 	lea    0xe36(%rip),%rdi        # 2008 <_IO_stdin_used+0x8>
    11d2:	b8 00 00 00 00       	mov    $0x0,%eax
    11d7:	e8 94 fe ff ff       	callq  1070 <printf@plt>
    11dc:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    11e0:	48 8d 70 14          	lea    0x14(%rax),%rsi
    11e4:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    11e8:	4c 8d 40 10          	lea    0x10(%rax),%r8
    11ec:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    11f0:	48 8d 78 0c          	lea    0xc(%rax),%rdi
    11f4:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    11f8:	48 8d 48 08          	lea    0x8(%rax),%rcx
    11fc:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    1200:	48 8d 50 04          	lea    0x4(%rax),%rdx
    1204:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    1208:	48 83 ec 08          	sub    $0x8,%rsp
    120c:	56                   	push   %rsi
    120d:	4d 89 c1             	mov    %r8,%r9
    1210:	49 89 f8             	mov    %rdi,%r8
    1213:	48 89 c6             	mov    %rax,%rsi
    1216:	48 8d 3d f3 0d 00 00 	lea    0xdf3(%rip),%rdi        # 2010 <_IO_stdin_used+0x10>
    121d:	b8 00 00 00 00       	mov    $0x0,%eax
    1222:	e8 49 fe ff ff       	callq  1070 <printf@plt>
    1227:	48 83 c4 10          	add    $0x10,%rsp
    122b:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    122f:	89 45 ec             	mov    %eax,-0x14(%rbp)
    1232:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    1236:	48 83 c0 04          	add    $0x4,%rax
    123a:	89 45 e8             	mov    %eax,-0x18(%rbp)
    123d:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    1241:	48 83 c0 08          	add    $0x8,%rax
    1245:	89 45 e4             	mov    %eax,-0x1c(%rbp)
    1248:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    124c:	48 83 c0 0c          	add    $0xc,%rax
    1250:	89 45 e0             	mov    %eax,-0x20(%rbp)
    1253:	8b 75 e0             	mov    -0x20(%rbp),%esi
    1256:	8b 4d e4             	mov    -0x1c(%rbp),%ecx
    1259:	8b 55 e8             	mov    -0x18(%rbp),%edx
    125c:	8b 45 ec             	mov    -0x14(%rbp),%eax
    125f:	41 89 f0             	mov    %esi,%r8d
    1262:	89 c6                	mov    %eax,%esi
    1264:	48 8d 3d c4 0d 00 00 	lea    0xdc4(%rip),%rdi        # 202f <_IO_stdin_used+0x2f>
    126b:	b8 00 00 00 00       	mov    $0x0,%eax
    1270:	e8 fb fd ff ff       	callq  1070 <printf@plt>
    1275:	48 8d 45 dc          	lea    -0x24(%rbp),%rax
    1279:	48 89 45 f0          	mov    %rax,-0x10(%rbp)
    127d:	48 8d 45 dc          	lea    -0x24(%rbp),%rax
    1281:	48 89 c6             	mov    %rax,%rsi
    1284:	48 8d 3d b1 0d 00 00 	lea    0xdb1(%rip),%rdi        # 203c <_IO_stdin_used+0x3c>
    128b:	b8 00 00 00 00       	mov    $0x0,%eax
    1290:	e8 db fd ff ff       	callq  1070 <printf@plt>
    1295:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    1299:	48 89 c6             	mov    %rax,%rsi
    129c:	48 8d 3d 65 0d 00 00 	lea    0xd65(%rip),%rdi        # 2008 <_IO_stdin_used+0x8>
    12a3:	b8 00 00 00 00       	mov    $0x0,%eax
    12a8:	e8 c3 fd ff ff       	callq  1070 <printf@plt>
    12ad:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    12b1:	8b 00                	mov    (%rax),%eax
    12b3:	89 c6                	mov    %eax,%esi
    12b5:	48 8d 3d 4c 0d 00 00 	lea    0xd4c(%rip),%rdi        # 2008 <_IO_stdin_used+0x8>
    12bc:	b8 00 00 00 00       	mov    $0x0,%eax
    12c1:	e8 aa fd ff ff       	callq  1070 <printf@plt>
    12c6:	90                   	nop
    12c7:	48 8b 45 f8          	mov    -0x8(%rbp),%rax
    12cb:	64 48 33 04 25 28 00 	xor    %fs:0x28,%rax
    12d2:	00 00 
    12d4:	74 05                	je     12db <a_1+0x172>
    12d6:	e8 85 fd ff ff       	callq  1060 <__stack_chk_fail@plt>
    12db:	c9                   	leaveq 
    12dc:	c3                   	retq   

00000000000012dd <a_0>:
    12dd:	f3 0f 1e fa          	endbr64 
    12e1:	55                   	push   %rbp
    12e2:	48 89 e5             	mov    %rsp,%rbp
    12e5:	48 83 ec 20          	sub    $0x20,%rsp
    12e9:	64 48 8b 04 25 28 00 	mov    %fs:0x28,%rax
    12f0:	00 00 
    12f2:	48 89 45 f8          	mov    %rax,-0x8(%rbp)
    12f6:	31 c0                	xor    %eax,%eax
    12f8:	48 c7 45 f0 00 00 00 	movq   $0x0,-0x10(%rbp)
    12ff:	00 
    1300:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%rbp)
    1307:	8b 45 e0             	mov    -0x20(%rbp),%eax
    130a:	89 45 e4             	mov    %eax,-0x1c(%rbp)
    130d:	8b 45 e4             	mov    -0x1c(%rbp),%eax
    1310:	89 45 e8             	mov    %eax,-0x18(%rbp)
    1313:	8b 45 e8             	mov    -0x18(%rbp),%eax
    1316:	89 45 ec             	mov    %eax,-0x14(%rbp)
    1319:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    131d:	48 89 c6             	mov    %rax,%rsi
    1320:	48 8d 3d e1 0c 00 00 	lea    0xce1(%rip),%rdi        # 2008 <_IO_stdin_used+0x8>
    1327:	b8 00 00 00 00       	mov    $0x0,%eax
    132c:	e8 3f fd ff ff       	callq  1070 <printf@plt>
    1331:	48 8d 45 f0          	lea    -0x10(%rbp),%rax
    1335:	48 89 c6             	mov    %rax,%rsi
    1338:	48 8d 3d c9 0c 00 00 	lea    0xcc9(%rip),%rdi        # 2008 <_IO_stdin_used+0x8>
    133f:	b8 00 00 00 00       	mov    $0x0,%eax
    1344:	e8 27 fd ff ff       	callq  1070 <printf@plt>
    1349:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    134d:	48 8d 70 14          	lea    0x14(%rax),%rsi
    1351:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    1355:	4c 8d 40 10          	lea    0x10(%rax),%r8
    1359:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    135d:	48 8d 78 0c          	lea    0xc(%rax),%rdi
    1361:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    1365:	48 8d 48 08          	lea    0x8(%rax),%rcx
    1369:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    136d:	48 8d 50 04          	lea    0x4(%rax),%rdx
    1371:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    1375:	48 83 ec 08          	sub    $0x8,%rsp
    1379:	56                   	push   %rsi
    137a:	4d 89 c1             	mov    %r8,%r9
    137d:	49 89 f8             	mov    %rdi,%r8
    1380:	48 89 c6             	mov    %rax,%rsi
    1383:	48 8d 3d 86 0c 00 00 	lea    0xc86(%rip),%rdi        # 2010 <_IO_stdin_used+0x10>
    138a:	b8 00 00 00 00       	mov    $0x0,%eax
    138f:	e8 dc fc ff ff       	callq  1070 <printf@plt>
    1394:	48 83 c4 10          	add    $0x10,%rsp
    1398:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    139c:	89 45 ec             	mov    %eax,-0x14(%rbp)
    139f:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    13a3:	48 83 c0 04          	add    $0x4,%rax
    13a7:	89 45 e8             	mov    %eax,-0x18(%rbp)
    13aa:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    13ae:	48 83 c0 08          	add    $0x8,%rax
    13b2:	89 45 e4             	mov    %eax,-0x1c(%rbp)
    13b5:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    13b9:	48 83 c0 0c          	add    $0xc,%rax
    13bd:	89 45 e0             	mov    %eax,-0x20(%rbp)
    13c0:	8b 75 e0             	mov    -0x20(%rbp),%esi
    13c3:	8b 4d e4             	mov    -0x1c(%rbp),%ecx
    13c6:	8b 55 e8             	mov    -0x18(%rbp),%edx
    13c9:	8b 45 ec             	mov    -0x14(%rbp),%eax
    13cc:	41 89 f0             	mov    %esi,%r8d
    13cf:	89 c6                	mov    %eax,%esi
    13d1:	48 8d 3d 57 0c 00 00 	lea    0xc57(%rip),%rdi        # 202f <_IO_stdin_used+0x2f>
    13d8:	b8 00 00 00 00       	mov    $0x0,%eax
    13dd:	e8 8e fc ff ff       	callq  1070 <printf@plt>
    13e2:	90                   	nop
    13e3:	48 8b 45 f8          	mov    -0x8(%rbp),%rax
    13e7:	64 48 33 04 25 28 00 	xor    %fs:0x28,%rax
    13ee:	00 00 
    13f0:	74 05                	je     13f7 <a_0+0x11a>
    13f2:	e8 69 fc ff ff       	callq  1060 <__stack_chk_fail@plt>
    13f7:	c9                   	leaveq 
    13f8:	c3                   	retq   

00000000000013f9 <a_3>:
    13f9:	f3 0f 1e fa          	endbr64 
    13fd:	55                   	push   %rbp
    13fe:	48 89 e5             	mov    %rsp,%rbp
    1401:	48 83 ec 20          	sub    $0x20,%rsp
    1405:	64 48 8b 04 25 28 00 	mov    %fs:0x28,%rax
    140c:	00 00 
    140e:	48 89 45 f8          	mov    %rax,-0x8(%rbp)
    1412:	31 c0                	xor    %eax,%eax
    1414:	48 c7 45 f0 03 00 00 	movq   $0x3,-0x10(%rbp)
    141b:	00 
    141c:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%rbp)
    1423:	8b 45 e0             	mov    -0x20(%rbp),%eax
    1426:	89 45 e4             	mov    %eax,-0x1c(%rbp)
    1429:	8b 45 e4             	mov    -0x1c(%rbp),%eax
    142c:	89 45 e8             	mov    %eax,-0x18(%rbp)
    142f:	8b 45 e8             	mov    -0x18(%rbp),%eax
    1432:	89 45 ec             	mov    %eax,-0x14(%rbp)
    1435:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    1439:	48 89 c6             	mov    %rax,%rsi
    143c:	48 8d 3d c5 0b 00 00 	lea    0xbc5(%rip),%rdi        # 2008 <_IO_stdin_used+0x8>
    1443:	b8 00 00 00 00       	mov    $0x0,%eax
    1448:	e8 23 fc ff ff       	callq  1070 <printf@plt>
    144d:	48 8d 45 f0          	lea    -0x10(%rbp),%rax
    1451:	48 89 c6             	mov    %rax,%rsi
    1454:	48 8d 3d ad 0b 00 00 	lea    0xbad(%rip),%rdi        # 2008 <_IO_stdin_used+0x8>
    145b:	b8 00 00 00 00       	mov    $0x0,%eax
    1460:	e8 0b fc ff ff       	callq  1070 <printf@plt>
    1465:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    1469:	48 8d 70 14          	lea    0x14(%rax),%rsi
    146d:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    1471:	4c 8d 40 10          	lea    0x10(%rax),%r8
    1475:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    1479:	48 8d 78 0c          	lea    0xc(%rax),%rdi
    147d:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    1481:	48 8d 48 08          	lea    0x8(%rax),%rcx
    1485:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    1489:	48 8d 50 04          	lea    0x4(%rax),%rdx
    148d:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    1491:	48 83 ec 08          	sub    $0x8,%rsp
    1495:	56                   	push   %rsi
    1496:	4d 89 c1             	mov    %r8,%r9
    1499:	49 89 f8             	mov    %rdi,%r8
    149c:	48 89 c6             	mov    %rax,%rsi
    149f:	48 8d 3d 6a 0b 00 00 	lea    0xb6a(%rip),%rdi        # 2010 <_IO_stdin_used+0x10>
    14a6:	b8 00 00 00 00       	mov    $0x0,%eax
    14ab:	e8 c0 fb ff ff       	callq  1070 <printf@plt>
    14b0:	48 83 c4 10          	add    $0x10,%rsp
    14b4:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    14b8:	89 45 ec             	mov    %eax,-0x14(%rbp)
    14bb:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    14bf:	48 83 c0 04          	add    $0x4,%rax
    14c3:	89 45 e8             	mov    %eax,-0x18(%rbp)
    14c6:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    14ca:	48 83 c0 08          	add    $0x8,%rax
    14ce:	89 45 e4             	mov    %eax,-0x1c(%rbp)
    14d1:	48 8b 45 f0          	mov    -0x10(%rbp),%rax
    14d5:	48 83 c0 0c          	add    $0xc,%rax
    14d9:	89 45 e0             	mov    %eax,-0x20(%rbp)
    14dc:	8b 75 e0             	mov    -0x20(%rbp),%esi
    14df:	8b 4d e4             	mov    -0x1c(%rbp),%ecx
    14e2:	8b 55 e8             	mov    -0x18(%rbp),%edx
    14e5:	8b 45 ec             	mov    -0x14(%rbp),%eax
    14e8:	41 89 f0             	mov    %esi,%r8d
    14eb:	89 c6                	mov    %eax,%esi
    14ed:	48 8d 3d 3b 0b 00 00 	lea    0xb3b(%rip),%rdi        # 202f <_IO_stdin_used+0x2f>
    14f4:	b8 00 00 00 00       	mov    $0x0,%eax
    14f9:	e8 72 fb ff ff       	callq  1070 <printf@plt>
    14fe:	90                   	nop
    14ff:	48 8b 45 f8          	mov    -0x8(%rbp),%rax
    1503:	64 48 33 04 25 28 00 	xor    %fs:0x28,%rax
    150a:	00 00 
    150c:	74 05                	je     1513 <a_3+0x11a>
    150e:	e8 4d fb ff ff       	callq  1060 <__stack_chk_fail@plt>
    1513:	c9                   	leaveq 
    1514:	c3                   	retq   

0000000000001515 <main>:
    1515:	f3 0f 1e fa          	endbr64 
    1519:	55                   	push   %rbp
    151a:	48 89 e5             	mov    %rsp,%rbp
    151d:	b8 00 00 00 00       	mov    $0x0,%eax
    1522:	e8 42 fc ff ff       	callq  1169 <a_1>
    1527:	b8 00 00 00 00       	mov    $0x0,%eax
    152c:	e8 ac fd ff ff       	callq  12dd <a_0>
    1531:	b8 00 00 00 00       	mov    $0x0,%eax
    1536:	e8 be fe ff ff       	callq  13f9 <a_3>
    153b:	90                   	nop
    153c:	5d                   	pop    %rbp
    153d:	c3                   	retq   
    153e:	66 90                	xchg   %ax,%ax

/*
 * arm v8
 */
void a_1()
{
  400590:	a9bd7bfd 	stp	x29, x30, [sp, #-48]!
  400594:	910003fd 	mov	x29, sp
	int *a = 1;
  400598:	d2800020 	mov	x0, #0x1                   	// #1
  40059c:	f9000fa0 	str	x0, [x29, #24]	; a = [x29+24] = 1
	int byte1, byte2, byte3, byte4;
	int b = 2;
  4005a0:	52800040 	mov	w0, #0x2                   	// #2
  4005a4:	b90017a0 	str	w0, [x29, #20]	; b = [x29+20] = 2

	byte1 = byte2 = byte3 = byte4 = 0;
  4005a8:	b9002fbf 	str	wzr, [x29, #44]	; byte4
  4005ac:	b9402fa0 	ldr	w0, [x29, #44]	; load byte4
  4005b0:	b9002ba0 	str	w0, [x29, #40]	; save byte3
  4005b4:	b9402ba0 	ldr	w0, [x29, #40]	; load byte3
  4005b8:	b90027a0 	str	w0, [x29, #36]	; save byte2
  4005bc:	b94027a0 	ldr	w0, [x29, #36]	; load byte2
  4005c0:	b90023a0 	str	w0, [x29, #32]	; save byte1

	printf("a=%x\n", a);	// 1
  4005c4:	f9400fa1 	ldr	x1, [x29, #24]			; x1 = [x29+24] = a = 1
  4005c8:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  4005cc:	91244000 	add	x0, x0, #0x910
  4005d0:	97ffff98 	bl	400430 <printf@plt>
	printf("a=%x\n", &a);	// b7d24708
  4005d4:	910063a1 	add	x1, x29, #0x18			; a self address
  4005d8:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  4005dc:	91244000 	add	x0, x0, #0x910
  4005e0:	97ffff94 	bl	400430 <printf@plt>

	printf("0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n", &a[0], &a[1], &a[2], &a[3], &a[4], &a[5]); // 0x1 0x5 0x9 0xd 0x11 0x15
  4005e4:	f9400fa1 	ldr	x1, [x29, #24]	; x1 = a = address 1
  4005e8:	f9400fa0 	ldr	x0, [x29, #24]	; x0 = a = address 1
  4005ec:	91001002 	add	x2, x0, #0x4	; x2 = a + 4, 1 + 4 = 5
  4005f0:	f9400fa0 	ldr	x0, [x29, #24]	; x0 = 1
  4005f4:	91002003 	add	x3, x0, #0x8	; x3 = 1 + 8 = 9
  4005f8:	f9400fa0 	ldr	x0, [x29, #24];	; x0 = 1
  4005fc:	91003004 	add	x4, x0, #0xc	; x4 = 1 + 0xc = 0xd
  400600:	f9400fa0 	ldr	x0, [x29, #24]  ; x0 = 1
  400604:	91004005 	add	x5, x0, #0x10   ; x5 = 1 + 0x10 = 0x11
  400608:	f9400fa0 	ldr	x0, [x29, #24]  ; x0 = 1
  40060c:	91005006 	add	x6, x0, #0x14   ; x6 = 1 + 0x14 = 0x15
  400610:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400614:	91246000 	add	x0, x0, #0x918 ; parameter
  400618:	97ffff86 	bl	400430 <printf@plt>
	//printf("%x %x %x %x\n", a[0], a[1], a[2], a[3]);	 // Segmentation fault (core dumped)

	byte1 = (char *)&a[0];
  40061c:	f9400fa0 	ldr	x0, [x29, #24] ; x0 = 1
  400620:	b90023a0 	str	w0, [x29, #32] ; byte1 = 1
	byte2 = (char *)&a[1];
  400624:	f9400fa0 	ldr	x0, [x29, #24] ; x0 = 1
  400628:	91001000 	add	x0, x0, #0x4   ; x0 = 1 + 4 = 5
  40062c:	b90027a0 	str	w0, [x29, #36] ; byte2 = 5
	byte3 = (char *)&a[2];
  400630:	f9400fa0 	ldr	x0, [x29, #24] ; x0 = 1
  400634:	91002000 	add	x0, x0, #0x8   ; x0 = 1 + 0x8
  400638:	b9002ba0 	str	w0, [x29, #40] ; byte3 = 9
	byte4 = (char *)&a[3];
  40063c:	f9400fa0 	ldr	x0, [x29, #24] ; x0 = 1
  400640:	91003000 	add	x0, x0, #0xc   ; x0 = 1 + 0xc
  400644:	b9002fa0 	str	w0, [x29, #44] ; byte4 = 0xd

	printf("%x %x %x %x\n", byte1, byte2, byte3, byte4); // 1 5 9 d
  400648:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  40064c:	9124e000 	add	x0, x0, #0x938 ; parameter
  400650:	b9402fa4 	ldr	w4, [x29, #44] ; byte4
  400654:	b9402ba3 	ldr	w3, [x29, #40] ; byte3
  400658:	b94027a2 	ldr	w2, [x29, #36] ; byte2
  40065c:	b94023a1 	ldr	w1, [x29, #32] ; byte1
  400660:	97ffff74 	bl	400430 <printf@plt>

	a = &b;
  400664:	910053a0 	add	x0, x29, #0x14 ; b = x29 + 0x14, b address
  400668:	f9000fa0 	str	x0, [x29, #24] ; a = &b, save b address to a
	printf("b=%x\n", &b);	// b7d246f4
  40066c:	910053a1 	add	x1, x29, #0x14 ; b address
  400670:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400674:	91252000 	add	x0, x0, #0x948
  400678:	97ffff6e 	bl	400430 <printf@plt>
	printf("a=%x\n", a);	// b7d246f4
  40067c:	f9400fa1 	ldr	x1, [x29, #24] ; point to b address
  400680:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400684:	91244000 	add	x0, x0, #0x910
  400688:	97ffff6a 	bl	400430 <printf@plt>
	printf("a=%x\n", *a);	// 2
  40068c:	f9400fa0 	ldr	x0, [x29, #24] ; point to b address
  400690:	b9400001 	ldr	w1, [x0]       ; get value
  400694:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400698:	91244000 	add	x0, x0, #0x910
  40069c:	97ffff65 	bl	400430 <printf@plt>
}
  4006a0:	d503201f 	nop
  4006a4:	a8c37bfd 	ldp	x29, x30, [sp], #48
  4006a8:	d65f03c0 	ret

00000000004006ac <a_0>:

void a_0()
{
  4006ac:	a9bd7bfd 	stp	x29, x30, [sp, #-48]!
  4006b0:	910003fd 	mov	x29, sp
	int *a = 0;
  4006b4:	f9000fbf 	str	xzr, [x29, #24]
	int byte1, byte2, byte3, byte4;

	byte1 = byte2 = byte3 = byte4 = 0;
  4006b8:	b9002fbf 	str	wzr, [x29, #44]
  4006bc:	b9402fa0 	ldr	w0, [x29, #44]
  4006c0:	b9002ba0 	str	w0, [x29, #40]
  4006c4:	b9402ba0 	ldr	w0, [x29, #40]
  4006c8:	b90027a0 	str	w0, [x29, #36]
  4006cc:	b94027a0 	ldr	w0, [x29, #36]
  4006d0:	b90023a0 	str	w0, [x29, #32]

	printf("a=%x\n", a);	// 0
  4006d4:	f9400fa1 	ldr	x1, [x29, #24]
  4006d8:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  4006dc:	91244000 	add	x0, x0, #0x910
  4006e0:	97ffff54 	bl	400430 <printf@plt>
	printf("a=%x\n", &a);	// c03f1498
  4006e4:	910063a1 	add	x1, x29, #0x18
  4006e8:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  4006ec:	91244000 	add	x0, x0, #0x910
  4006f0:	97ffff50 	bl	400430 <printf@plt>

	printf("0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n", &a[0], &a[1], &a[2], &a[3], &a[4], &a[5]); // 0x0 0x4 0x8 0xc 0x10 0x14
  4006f4:	f9400fa1 	ldr	x1, [x29, #24]
  4006f8:	f9400fa0 	ldr	x0, [x29, #24]
  4006fc:	91001002 	add	x2, x0, #0x4
  400700:	f9400fa0 	ldr	x0, [x29, #24]
  400704:	91002003 	add	x3, x0, #0x8
  400708:	f9400fa0 	ldr	x0, [x29, #24]
  40070c:	91003004 	add	x4, x0, #0xc
  400710:	f9400fa0 	ldr	x0, [x29, #24]
  400714:	91004005 	add	x5, x0, #0x10
  400718:	f9400fa0 	ldr	x0, [x29, #24]
  40071c:	91005006 	add	x6, x0, #0x14
  400720:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400724:	91246000 	add	x0, x0, #0x918
  400728:	97ffff42 	bl	400430 <printf@plt>
	//printf("%x %x %x %x\n", a[0], a[1], a[2], a[3]);	 // Segmentation fault (core dumped)

	byte1 = (char *)&a[0];
  40072c:	f9400fa0 	ldr	x0, [x29, #24]
  400730:	b90023a0 	str	w0, [x29, #32]
	byte2 = (char *)&a[1];
  400734:	f9400fa0 	ldr	x0, [x29, #24]
  400738:	91001000 	add	x0, x0, #0x4
  40073c:	b90027a0 	str	w0, [x29, #36]
	byte3 = (char *)&a[2];
  400740:	f9400fa0 	ldr	x0, [x29, #24]
  400744:	91002000 	add	x0, x0, #0x8
  400748:	b9002ba0 	str	w0, [x29, #40]
	byte4 = (char *)&a[3];
  40074c:	f9400fa0 	ldr	x0, [x29, #24]
  400750:	91003000 	add	x0, x0, #0xc
  400754:	b9002fa0 	str	w0, [x29, #44]

	printf("%x %x %x %x\n", byte1, byte2, byte3, byte4); // 0 4 8 c
  400758:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  40075c:	9124e000 	add	x0, x0, #0x938
  400760:	b9402fa4 	ldr	w4, [x29, #44]
  400764:	b9402ba3 	ldr	w3, [x29, #40]
  400768:	b94027a2 	ldr	w2, [x29, #36]
  40076c:	b94023a1 	ldr	w1, [x29, #32]
  400770:	97ffff30 	bl	400430 <printf@plt>
}
  400774:	d503201f 	nop
  400778:	a8c37bfd 	ldp	x29, x30, [sp], #48
  40077c:	d65f03c0 	ret

0000000000400780 <a_3>:

void a_3()
{
  400780:	a9bd7bfd 	stp	x29, x30, [sp, #-48]!
  400784:	910003fd 	mov	x29, sp
	int *a = 3;
  400788:	d2800060 	mov	x0, #0x3                   	// #3
  40078c:	f9000fa0 	str	x0, [x29, #24]
	int byte1, byte2, byte3, byte4;

	byte1 = byte2 = byte3 = byte4 = 0;
  400790:	b9002fbf 	str	wzr, [x29, #44]
  400794:	b9402fa0 	ldr	w0, [x29, #44]
  400798:	b9002ba0 	str	w0, [x29, #40]
  40079c:	b9402ba0 	ldr	w0, [x29, #40]
  4007a0:	b90027a0 	str	w0, [x29, #36]
  4007a4:	b94027a0 	ldr	w0, [x29, #36]
  4007a8:	b90023a0 	str	w0, [x29, #32]

	printf("a=%x\n", a);	// 3
  4007ac:	f9400fa1 	ldr	x1, [x29, #24]
  4007b0:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  4007b4:	91244000 	add	x0, x0, #0x910
  4007b8:	97ffff1e 	bl	400430 <printf@plt>
	printf("a=%x\n", &a);	// ce340a48
  4007bc:	910063a1 	add	x1, x29, #0x18
  4007c0:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  4007c4:	91244000 	add	x0, x0, #0x910
  4007c8:	97ffff1a 	bl	400430 <printf@plt>

	printf("0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n", &a[0], &a[1], &a[2], &a[3], &a[4], &a[5]); // 0x3 0x7 0xb 0xf 0x13 0x17
  4007cc:	f9400fa1 	ldr	x1, [x29, #24]
  4007d0:	f9400fa0 	ldr	x0, [x29, #24]
  4007d4:	91001002 	add	x2, x0, #0x4
  4007d8:	f9400fa0 	ldr	x0, [x29, #24]
  4007dc:	91002003 	add	x3, x0, #0x8
  4007e0:	f9400fa0 	ldr	x0, [x29, #24]
  4007e4:	91003004 	add	x4, x0, #0xc
  4007e8:	f9400fa0 	ldr	x0, [x29, #24]
  4007ec:	91004005 	add	x5, x0, #0x10
  4007f0:	f9400fa0 	ldr	x0, [x29, #24]
  4007f4:	91005006 	add	x6, x0, #0x14
  4007f8:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  4007fc:	91246000 	add	x0, x0, #0x918
  400800:	97ffff0c 	bl	400430 <printf@plt>
	//printf("%x %x %x %x\n", a[0], a[1], a[2], a[3]);	 // Segmentation fault (core dumped)

	byte1 = (char *)&a[0];
  400804:	f9400fa0 	ldr	x0, [x29, #24]
  400808:	b90023a0 	str	w0, [x29, #32]
	byte2 = (char *)&a[1];
  40080c:	f9400fa0 	ldr	x0, [x29, #24]
  400810:	91001000 	add	x0, x0, #0x4
  400814:	b90027a0 	str	w0, [x29, #36]
	byte3 = (char *)&a[2];
  400818:	f9400fa0 	ldr	x0, [x29, #24]
  40081c:	91002000 	add	x0, x0, #0x8
  400820:	b9002ba0 	str	w0, [x29, #40]
	byte4 = (char *)&a[3];
  400824:	f9400fa0 	ldr	x0, [x29, #24]
  400828:	91003000 	add	x0, x0, #0xc
  40082c:	b9002fa0 	str	w0, [x29, #44]

	printf("%x %x %x %x\n", byte1, byte2, byte3, byte4); // 3 7 b f
  400830:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400834:	9124e000 	add	x0, x0, #0x938
  400838:	b9402fa4 	ldr	w4, [x29, #44]
  40083c:	b9402ba3 	ldr	w3, [x29, #40]
  400840:	b94027a2 	ldr	w2, [x29, #36]
  400844:	b94023a1 	ldr	w1, [x29, #32]
  400848:	97fffefa 	bl	400430 <printf@plt>
}
  40084c:	d503201f 	nop
  400850:	a8c37bfd 	ldp	x29, x30, [sp], #48
  400854:	d65f03c0 	ret

0000000000400858 <main>:

void main()
{
  400858:	a9bf7bfd 	stp	x29, x30, [sp, #-16]!
  40085c:	910003fd 	mov	x29, sp
	a_1();
  400860:	97ffff4c 	bl	400590 <a_1>
	a_0();
  400864:	97ffff92 	bl	4006ac <a_0>
	a_3();
  400868:	97ffffc6 	bl	400780 <a_3>
}

/*
 * arm v7
 */
void a_1()
{
   10490:	e92d4800 	push	{fp, lr}
   10494:	e28db004 	add	fp, sp, #4
   10498:	e24dd020 	sub	sp, sp, #32
	int *a = 1;
   1049c:	e3a03001 	mov	r3, #1
   104a0:	e50b3018 	str	r3, [fp, #-24]	; 0xffffffe8	a
	int byte1, byte2, byte3, byte4;
	int b = 2;
   104a4:	e3a03002 	mov	r3, #2
   104a8:	e50b301c 	str	r3, [fp, #-28]	; 0xffffffe4	b

	byte1 = byte2 = byte3 = byte4 = 0;
   104ac:	e3a03000 	mov	r3, #0
   104b0:	e50b3008 	str	r3, [fp, #-8]	; save byte4
   104b4:	e51b3008 	ldr	r3, [fp, #-8]	; load byte4
   104b8:	e50b300c 	str	r3, [fp, #-12]	; save byte3
   104bc:	e51b300c 	ldr	r3, [fp, #-12]	; load byte3
   104c0:	e50b3010 	str	r3, [fp, #-16]	; save byte2
   104c4:	e51b3010 	ldr	r3, [fp, #-16]	; load byte2
   104c8:	e50b3014 	str	r3, [fp, #-20]	; 0xffffffec	save byte1

	printf("a=%x\n", a);	// 1
   104cc:	e51b3018 	ldr	r3, [fp, #-24]	; 0xffffffe8	r3 = a = 1
   104d0:	e1a01003 	mov	r1, r3		;		r1 = 1
   104d4:	e59f00f4 	ldr	r0, [pc, #244]	; 105d0 <main+0x140>
   104d8:	ebffff8c 	bl	10310 <printf@plt>
	printf("a=%x\n", &a);	// b7d24708
   104dc:	e24b3018 	sub	r3, fp, #24	; r3 = a self address
   104e0:	e1a01003 	mov	r1, r3		; r1 = a self address
   104e4:	e59f00e4 	ldr	r0, [pc, #228]	; 105d0 <main+0x140>
   104e8:	ebffff88 	bl	10310 <printf@plt>

	printf("%x %x %x %x\n", &a[0], &a[1], &a[2], &a[3]); // 1 5 9 d
   104ec:	e51b1018 	ldr	r1, [fp, #-24]	; 0xffffffe8	r1 = a = 1
   104f0:	e51b3018 	ldr	r3, [fp, #-24]	; 0xffffffe8	r3 = a = 1
   104f4:	e2832004 	add	r2, r3, #4	;		r2 = 1 + 4 = 5
   104f8:	e51b3018 	ldr	r3, [fp, #-24]	; 0xffffffe8	; r3 = a = 1
   104fc:	e2830008 	add	r0, r3, #8			; r3 = 1 + 8 = 9
   10500:	e51b3018 	ldr	r3, [fp, #-24]	; 0xffffffe8	; r3 = a = 1
   10504:	e283300c 	add	r3, r3, #12			; r3 = 1 + 12 = 13 = D
   10508:	e58d3000 	str	r3, [sp]			; [sp] = D
   1050c:	e1a03000 	mov	r3, r0				; r3 = r0 = 9
   10510:	e59f00bc 	ldr	r0, [pc, #188]	; 105d4 <main+0x144>
   10514:	ebffff7d 	bl	10310 <printf@plt>
	printf("%x %x %x %x\n", a[0], a[1], a[2], a[3]);	 // Segmentation fault (core dumped)
   10518:	e51b3018 	ldr	r3, [fp, #-24]	; 0xffffffe8	a
   1051c:	e5931000 	ldr	r1, [r3]			get value a[0]
   10520:	e51b3018 	ldr	r3, [fp, #-24]	; 0xffffffe8	a
   10524:	e2833004 	add	r3, r3, #4	;		a + 4 ===> a + 1 = a + sizeof(char*) = a + 4
   10528:	e5932000 	ldr	r2, [r3]	;		get value a[1]
   1052c:	e51b3018 	ldr	r3, [fp, #-24]	; 0xffffffe8	a
   10530:	e2833008 	add	r3, r3, #8	;		a + 8
   10534:	e5930000 	ldr	r0, [r3]	;		get a[2] value
   10538:	e51b3018 	ldr	r3, [fp, #-24]	; 0xffffffe8	a
   1053c:	e283300c 	add	r3, r3, #12			a[3]
   10540:	e5933000 	ldr	r3, [r3]			get a[3] value
   10544:	e58d3000 	str	r3, [sp]	;		stack transmit parameter
   10548:	e1a03000 	mov	r3, r0
   1054c:	e59f0080 	ldr	r0, [pc, #128]	; 105d4 <main+0x144>
   10550:	ebffff6e 	bl	10310 <printf@plt>

	byte1 = (char *)&a[0];
   10554:	e51b3018 	ldr	r3, [fp, #-24]	; 0xffffffe8	a
   10558:	e50b3014 	str	r3, [fp, #-20]	; 0xffffffec	save byte1
	byte2 = (char *)&a[1];
   1055c:	e51b3018 	ldr	r3, [fp, #-24]	; 0xffffffe8	a
   10560:	e2833004 	add	r3, r3, #4	;		a + 4
   10564:	e50b3010 	str	r3, [fp, #-16]	;		save byte2
	byte3 = (char *)&a[2];
   10568:	e51b3018 	ldr	r3, [fp, #-24]	; 0xffffffe8	a
   1056c:	e2833008 	add	r3, r3, #8	;		a + 8
   10570:	e50b300c 	str	r3, [fp, #-12]	;		save byte3
	byte4 = (char *)&a[3];
   10574:	e51b3018 	ldr	r3, [fp, #-24]	; 0xffffffe8	a
   10578:	e283300c 	add	r3, r3, #12	;		a + 12
   1057c:	e50b3008 	str	r3, [fp, #-8]	;		save byte4

	printf("%x %x %x %x\n", byte1, byte2, byte3, byte4); // 1 5 9 d
   10580:	e51b3008 	ldr	r3, [fp, #-8]
   10584:	e58d3000 	str	r3, [sp]	; byte4 ---> sp , 使用sp传递超过4个的参数
   10588:	e51b300c 	ldr	r3, [fp, #-12]
   1058c:	e51b2010 	ldr	r2, [fp, #-16]
   10590:	e51b1014 	ldr	r1, [fp, #-20]	; 0xffffffec
   10594:	e59f0038 	ldr	r0, [pc, #56]	; 105d4 <main+0x144>
   10598:	ebffff5c 	bl	10310 <printf@plt>

	a = &b;
   1059c:	e24b301c 	sub	r3, fp, #28	; b address
   105a0:	e50b3018 	str	r3, [fp, #-24]	; 0xffffffe8	a = b address
	printf("a=%x\n", a);	// b7d246f4
   105a4:	e51b3018 	ldr	r3, [fp, #-24]	; 0xffffffe8	a
   105a8:	e1a01003 	mov	r1, r3		; b address
   105ac:	e59f001c 	ldr	r0, [pc, #28]	; 105d0 <main+0x140>
   105b0:	ebffff56 	bl	10310 <printf@plt>
	printf("a=%x\n", *a);	// 2
   105b4:	e51b3018 	ldr	r3, [fp, #-24]	; 0xffffffe8	a
   105b8:	e5933000 	ldr	r3, [r3]	; *a
   105bc:	e1a01003 	mov	r1, r3		; r1 = 2
   105c0:	e59f0008 	ldr	r0, [pc, #8]	; 105d0 <main+0x140>
   105c4:	ebffff51 	bl	10310 <printf@plt>
}



#endif

